package edu.umuc.cmsc495_final_project;

import java.io.Serializable;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;

public class RestaurantTime implements Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = -4616420737293133637L;
	private int hour; //24 hour time to avoid am/pm
	private int minute;
	private int second;
	
	private int year;
	private int month;
	private String StringMonth;
	private int day;
	
	public RestaurantTime(){
		DateFormat dateFormatDay = new SimpleDateFormat("d");
		DateFormat dateFormatMonth = new SimpleDateFormat("MMMM");
		DateFormat dateFormatMonthNum = new SimpleDateFormat("m");
		DateFormat dateFormatYear = new SimpleDateFormat("yyyy");
		DateFormat dateFormatHour = new SimpleDateFormat("H");
		DateFormat dateFormatMinute = new SimpleDateFormat("m");
		DateFormat dateFormatSecond = new SimpleDateFormat("s");
	    
		Date date = new Date();
	    
		day = Integer.parseInt(dateFormatDay.format(date));
		StringMonth = dateFormatMonth.format(date);
		month = Integer.parseInt(dateFormatMonthNum.format(date));
		year = Integer.parseInt(dateFormatYear.format(date));
		hour = Integer.parseInt(dateFormatHour.format(date));
		minute = Integer.parseInt(dateFormatMinute.format(date));
		second = Integer.parseInt(dateFormatSecond.format(date));
	}
	
	public RestaurantTime(int day, months StringMonth, int year){
		this.day = day;
		this.setStringMonth(StringMonth.toString());
		this.year = year;
	}
	
	public RestaurantTime(int hour, int minute){
		this.hour = hour;
		this.minute = minute;
	}
	
	public RestaurantTime(int day, months StringMonth, int year, int hour, int minute, int second){
		this.day = day;
		this.setStringMonth(StringMonth.toString());
		this.year = year;
		this.hour = hour;
		this.minute = minute;
		this.second = second;
	}
	
	public RestaurantTime(int day, int month, int year, int hour, int minute, int second){
		this.day = day;
		this.month = month;
		this.year = year;
		this.hour = hour;
		this.minute = minute;
		this.second = second;
	}
	
	public int getHour() {
		return hour;
	}
	
	public void setHour(int hour) {
		this.hour = hour;
	}
	
	public int getMinute() {
		return minute;
	}
	
	public void setMinute(int minute) {
		this.minute = minute;
	}
	
	public int getSecond() {
		return second;
	}
	
	public void setSecond(int second) {
		this.second = second;
	}
	
	public int getYear() {
		return year;
	}
	
	public void setYear(int year) {
		this.year = year;
	}
	
	public int getMonth() {
		return month;
	}
	
	public void setMonth(int month) {
		this.month = month;
	}
	
	public String getStringMonth() {
		return StringMonth;
	}

	public void setStringMonth(String stringMonth) {
		StringMonth = stringMonth;
	}
	
	public int getDay() {
		return day;
	}
	
	public void setDay(int day) {
		this.day = day;
	}
	
	public String hoursOfOp(){
		return hour+":"+minute;
	}
	
	public String getCurrentTime(){
		return hour + ":" + minute;
	}
	
	public String toString(){
		return StringMonth + " " + day + ", " + year + " - " + hour + ":" + minute;
	}
}
